import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect:'index'
  },
  {
    path: "/index",
    name:'首页',
    component:()=>import('../views/Index.vue'),
    children:[
      {
        path:'users',
        name:'用户管理',
        component:()=>import('../views/index/Users'),
      },
      {
        path:'roles',
        name:'角色权限',
        component:()=>import('../views/index/Roles'),
      },
      {
        path:'reports',
        name:'数据报表',
        component:()=>import('../views/index/Reports'),
      }
    ]
  },
  {
    path:'/and',
    name:'and',
    component:()=>import('../views/And'),
  }
];

const router = new VueRouter({
  routes
});

export default router;
